home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / 8bit / cislib_b / prog.lst < prev    next >
File List  |  1995-04-22  |  3KB  |  68 lines

  1.  
  2. 60500 REM BASIC PROGRAM LISTER 
  3. 60510 REM  -- written by Gary Foster  74076,237 
  4. 60520 REM ================== 
  5. 60530 REM  The purpose of this program is to print a BASIC program 
  6. 60535 REM  that is stored on disk in listed format. 
  7. 60540 REM 
  8. 60550 REM  This program has several features not offered by the 
  9. 60555 REM  LIST"P: command. 
  10. 60560 REM 
  11. 60570 REM  <1> the top of each page will contain the program name, the 
  12. 60575 REM      version number, date of the listing, and page number. 
  13. 60580 REM 
  14. 60590 REM  <2> all printing is indented 10 spaces from the left margin 
  15. 60595 REM      to allow punching for notebooks 
  16. 60600 REM 
  17. 60610 REM  <3> this program will print six blank lines at the top and 
  18. 60615 REM      bottom of each page 
  19. 60620 REM      (in other words, it will skip over page perforations). 
  20. 60630 REM 
  21. 60640 REM  <4> this program will indent continuations of lines that 
  22. 60645 REM      are longer than your printer can accommodate. 
  23. 60650 REM      If you have a wide carriage printer, set variable LL in 
  24. 60655 REM      line 60730 to 132. 
  25. 60660 REM 
  26. 60670 REM  This program requires Microsoft Basic to execute ---- 
  27. 60675 REM  but it will print Atari Basic, Microsoft Basic, and other 
  28. 60680 REM  programs with line numbers 
  29. 60700 REM ================== 
  30. 60710 CLS:PRINT "PROGRAM LISTER":PRINT:PRINT 
  31. 60720 INPUT "Enter today's date: ";DATE$:PRINT 
  32. 60730 LC=0:PN%=1:LP=54:LM=10:LL=80 
  33. 60740 PRINT"Enter file name  (D?:NAME.EXT)" 
  34. 60750 INPUT A$:GOSUB 61020 
  35. 60760 IF F%=0 THEN PRINT:PRINT"** END OF FILE **":GOTO 61070 ELSE F$=A$ 
  36. 60770 INPUT "Enter program version no: ";V$ 
  37. 60780 SP%=1:OPEN #1, A$ INPUT:OPEN #3,"P:" OUTPUT 
  38. 60785 PRINT #3,CHR$(12):INPUT "Is paper properly positioned? ";X$ 
  39. 60790 IF X$<>"Y" THEN 60785 
  40. 60800 GOSUB 60900 
  41. 60810 IF EOF(1) THEN 60890 
  42. 60820 LINE INPUT #1,A$ 
  43. 60830 IF A$="" THEN 60820 
  44. 60840 L=INSTR(A$,CHR$(32)) 
  45. 60850 LN$=LEFT$(A$,L):LN=VAL(LN$) 
  46. 60860 GOSUB 60940 
  47. 60870 IF LC>=LP THEN GOSUB 61010:GOTO 60800 
  48. 60880 GOTO 60810 
  49. 60890 CLOSE #1:GOSUB 61010:PRINT:GOTO 61070 
  50. 60900 IF EOF(1) THEN RETURN 
  51. 60910 PRINT #3,TAB(LM) "Program Name - ";F$;"    Version: ";V$;TAB(LL-20) DATE$;TAB(LL-7) "Page "; 
  52. 60920 PRINT #3, USING "##";PN%:PN%=PN%+1 
  53. 60930 FOR I=1 TO SP%*2:PRINT #3, " ":NEXT I:LC=1+SP%*2:RETURN 
  54. 60940 PRINT #3, TAB(LM); 
  55. 60950 PRINT #3, USING "##### ";LN; 
  56. 60960 J=LEN(STR$(LN)):A$=RIGHT$(A$,LEN(A$)-J) 
  57. 60970 K=LL-LM-6 
  58. 60980 FOR I=1 TO LEN(A$) STEP K 
  59. 60990 PRINT #3,TAB(LM+6) MID$(A$,I,K):LC=LC+1 
  60. 61000 NEXT I:RETURN 
  61. 61010 FOR I=1 TO 66-LC:PRINT #3," ":NEXT I:LC=0:RETURN 
  62. 61020 REM See if file exists 
  63. 61030 I=1:F%=1:ON ERROR GOTO 61040:OPEN #1, A$ INPUT:CLOSE #1:ON ERROR GOTO 0:RETURN 
  64. 61040 PRINT:RESUME 61050 
  65. 61050 PRINT "** FILE NOT FOUND **":PRINT 
  66. 61060 LINE INPUT "Enter new file name: ";A$:GOTO 61020 
  67. 61070 END 
  68.